package service;

// 必须声明为public
public class SalesData {
    private int totalTickets = 0;
    private double totalAmount = 0;
    private int refundTickets = 0;
    private double refundAmount = 0;

    // 所有方法必须声明为public
    public void addSale(double price) {
        totalTickets++;
        totalAmount += price;
    }

    public void addRefund(double price) {
        refundTickets++;
        refundAmount += price * 0.9;
    }

    public int getTotalTickets() { return totalTickets; }
    public double getTotalAmount() { return totalAmount; }
    public int getRefundTickets() { return refundTickets; }
    public double getRefundAmount() { return refundAmount; }
    public double getNetIncome() { return totalAmount - refundAmount; }
}